package com.yh.homestay.controller;

import com.yh.homestay.common.HomeStayResult;
import com.yh.homestay.common.SysPermissionResult;
import com.yh.homestay.pojo.SysPermission;
import com.yh.homestay.service.SysPermissionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @ClassName SysPermissionController
 * @Description 权限Controller
 * @Date 2020/1/10 9:43
 */
@RestController
@Api(description = "权限管理")
@RequestMapping(value = "/permission")
public class SysPermissionController {

    @Autowired
    private SysPermissionService sysPermissionService;

    /**
     * @Date: 2020/1/10 10:49
     * @Description: permission信息展示
     * @param request
     * @return: com.yh.homestay.common.HomeStayResult
     */
    @RequestMapping(value = "/list",method = RequestMethod.POST)
    @ApiOperation(value = "permission信息展示", notes = "permission信息展示")
    public HomeStayResult showPermission(HttpServletRequest request){
        return sysPermissionService.showPermission(request);
    }

    /**
    * @Date: 2020/1/10 10:49
    * @Description: 更新permission信息
    * @param sysPermission
    * @return: com.yh.homestay.common.SysPermissionResult
    */
    @RequestMapping(value = "/update",method = RequestMethod.POST)
    @ApiOperation(value = "更新权限", notes = "更新权限信息")
    public SysPermissionResult updatePermission(SysPermission sysPermission){
        return sysPermissionService.updatePermission(sysPermission);
    }

    /**
    * @Date: 2020/1/10 10:51
    * @Description: 添加permission
    * @param
    * @return: com.yh.homestay.common.SysPermissionResult
    @RequestMapping("/add")
    public SysPermissionResult addPermission(){
        return null;
    }

    *//**
    * @Date: 2020/1/10 10:51
    * @Description: 删除permission
    * @param
    * @return: com.yh.homestay.common.SysPermissionResult
    *//*
    @RequestMapping("/delete")
    public SysPermissionResult deletePermission(){
        return null;
    }

    *//**
    * @Date: 2020/1/10 10:52
    * @Description: 批量删除permission
    * @param
    * @return: com.yh.homestay.common.SysPermissionResult
    *//*
    @RequestMapping("/deleteBatch")
    public SysPermissionResult deleteBatchPermission(){
        return null;
    }

    @RequestMapping("/one/{id}")
    public SysPermissionResult deleteBatchPermission(@PathVariable("id") String perId){
        return null;
    }*/
}
